package com.crm.system.service.impl;

import java.util.List;
import com.crm.common.utils.DateUtils;
import com.crm.common.utils.uuid.UUID;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.crm.system.mapper.BieDoctorMapper;
import com.crm.system.domain.BieDoctor;
import com.crm.system.service.IBieDoctorService;
import com.crm.common.core.text.Convert;

/**
 * 医护人员Service业务层处理
 * 
 * @author crm
 * @date 2021-05-10
 */
@Service
public class BieDoctorServiceImpl implements IBieDoctorService 
{
    @Autowired
    private BieDoctorMapper bieDoctorMapper;

    /**
     * 查询医护人员
     * 
     * @param doctorId 医护人员ID
     * @return 医护人员
     */
    @Override
    public BieDoctor selectBieDoctorById(String doctorId)
    {
        return bieDoctorMapper.selectBieDoctorById(doctorId);
    }

    /**
     * 查询医护人员列表
     * 
     * @param bieDoctor 医护人员
     * @return 医护人员
     */
    @Override
    public List<BieDoctor> selectBieDoctorList(BieDoctor bieDoctor)
    {
        return bieDoctorMapper.selectBieDoctorList(bieDoctor);
    }

    /**
     * 新增医护人员
     * 
     * @param bieDoctor 医护人员
     * @return 结果
     */
    @Override
    public int insertBieDoctor(BieDoctor bieDoctor)
    {
        bieDoctor.setDoctorId(UUID.randomUUID().toString());
        bieDoctor.setCreateTime(DateUtils.getNowDate());
        return bieDoctorMapper.insertBieDoctor(bieDoctor);
    }

    /**
     * 修改医护人员
     * 
     * @param bieDoctor 医护人员
     * @return 结果
     */
    @Override
    public int updateBieDoctor(BieDoctor bieDoctor)
    {
        return bieDoctorMapper.updateBieDoctor(bieDoctor);
    }

    /**
     * 删除医护人员对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteBieDoctorByIds(String ids)
    {
        return bieDoctorMapper.deleteBieDoctorByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除医护人员信息
     * 
     * @param doctorId 医护人员ID
     * @return 结果
     */
    @Override
    public int deleteBieDoctorById(String doctorId)
    {
        return bieDoctorMapper.deleteBieDoctorById(doctorId);
    }
}
